package com.houmeiyuan.huiguniang.modles.dao;

import com.houmeiyuan.huiguniang.modles.domain.OrderForm;
import com.houmeiyuan.huiguniang.modles.domain.ShopCar;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Repository
@Transactional
@Mapper
public interface OrderFormDao {
    /**
     * 通过id查状态信息
     *
     * @param id
     * @return
     */
    OrderForm selectById(Integer id);
	/**
     * 取消订单
     * @param orderForm
     * @return 影响行数
     */
    Integer cancelOrder(OrderForm orderForm);

    /**
     * 确认收货
     * @param orderform
     * @return 影响行数
     */
    Integer affirmOrder(OrderForm orderform);

    /**
     * 取消订单-确认收货
     *
     * @param orderForm
     * @return
     */
    Integer updateOrder(OrderForm orderForm);

    /**
     *
     * @param orderFormId
     * @param openId
     * @return
     */
    Integer DeleteByOrderFormId(@Param("openId")String openId,@Param("orderFormId") int orderFormId);

    /**
     *
     * @param params
     * @return
     */
    List<OrderForm> selectAll(Map<String,Object> params);

    /**
     * 添加订单
     * @param orderForm
     * @return
     */
    Integer addOrderForm(OrderForm orderForm);
}
